package edu.object_oriented.encapsulation;

public class Stu {

    private String name;

    private int age;
    //属性的封装    对外隐藏属性
    //外界如何使用    对外定义一个公开方法
    public void setName(String name){
        this.name = name;
    }
    public String getName(){
        return name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public Stu(String name, int age){
        this.name = name;
        this.age = age;
    }


    public Stu(){

    }









}
